<?php
    require_once('conexion.php');
    
    $email = $_POST['email'];
    $password = $_POST['password'];
    $ruta = $_POST['ruta'];
    
    $query = "SELECT * FROM clientes WHERE email='".$email."' AND password='".$password."'";
    $ejecucion = mysql_query($query, $conexion);
    
    if (mysql_num_rows($ejecucion) > 0){
        session_start();
        $_SESSION['usuario'] = $email;
        header('Location: ../'.$ruta);
    }
    else {
        header('Location: ../'.$ruta);
    }
?>
